/*
    Purpose: This file imports raw psid data extracts 
             and creates dta files that are then called
             into subsequent do-files in this folder.

    Creates: 
             FIMSEitherparentKids_SRC_SEO.dta
             FIMSFathersKids_SRC_SEO.dta
             FIMSFathers_SRC_SEO.dta
             FIMSMothersKids_SRC_SEO.dta
             number_children_info.dta
             PSID_raw_indfam.dta
             geopsid.dta
             PSID_raw_indfam_empvar.dta
             retrospective_info.dta
             xsection_weights_info.dta
             fam_change_info.dta
             geo_headspouse.dta
             parentalocc.dta
             extra_demographicvars.dta
*/

clear 
set more off
cd "$Mydirectory1/1_DataSources/PSID"

* FIMS
    preserve
    quietly run ./FIMS/FIMSCleaner.do
    restore
    clear

* Number of children 
    preserve 
    quietly run ./RawData/number_children.do
    restore 
    clear

* Main psid 
    preserve 
    quietly run ./RawData/PSID_raw_cleaner.do 
    restore 
    clear

* Geo variables (head-only)
    preserve 
    quietly run ./RawData/geovars_clean.do
    restore 
    clear

* Employment variables 
    preserve 
    quietly run ./RawData/PSID_raw_cleaner_emp.do
    restore 
    clear

* Retrospective father occupation 
    preserve 
    quietly run ./RawData/retrospective.do
    restore 
    clear

* Cross-sectional weights 
    preserve 
    quietly run ./RawData/xsection_weights.do
    restore 
    clear

* Family composition 
    preserve 
    quietly run ./RawData/family_comp.do
    restore 
    clear

* Geo variables for head and spouse
    preserve 
    quietly run ./RawData/geo_headspouse.do
    restore 
    clear

* Parental occupations
    preserve 
    quietly run ./RawData/parentalocc.do
    restore 
    clear

* Extra demographic variables for head and spouse
    preserve 
    quietly run ./RawData/extra_demographicvars.do
    restore 
    clear
